<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class SecurityUser extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //  `name` varchar(255) NOT NULL COMMENT '安保姓名',
        //  `phone` varchar(255) NOT NULL COMMENT '手机号',
        //  `password` varchar(255) NOT NULL COMMENT '密码',
        //  `province_id` int(11) NOT NULL COMMENT '省份ID',
        //  `city_id` int(11) NOT NULL COMMENT '城市ID',
        //  `district_id` int(11) NOT NULL COMMENT '区域ID',
        //  `car_id` int(11) NOT NULL COMMENT '安保车辆ID',
        //  `status` tinyint(1) NOT NULL COMMENT '状态，1：休息，2：巡逻，3：安保',
        //  `position` point NOT NULL COMMENT '位置坐标',
        //  `login_time` int(11) NOT NULL COMMENT '登陆时间',

        Schema::dropIfExists('security_user');
        Schema::create('security_user', function (Blueprint $table){
            $table->comment = "安保人员";
            $table->increments('id')->comment("ID");
            $table->string("name")->comment("安保姓名");
            $table->string("phone")->comment("手机号");
            $table->string("password")->comment("密码");
            $table->integer("province_id")->comment("省份");
            $table->integer("city_id")->comment("城市");
            $table->integer("district_id")->comment("区域");
            $table->integer("car_id")->comment("安保车辆ID");
            $table->tinyInteger("status")->comment("状态");   // '状态，1：休息，2：巡逻，3：安保',
            $table->point("position")->comment("位置坐标");
            $table->integer('login_time')->comment("登录时间")->default('0');

            $table->integer('create_time')->comment("创建时间");
            $table->integer('update_time')->comment("更新时间");
        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
